package day19;

import java.util.ArrayList;
import java.util.function.Function;

public class MethodCall {
    public static void main(String[] args) {
        ArrayList<Student> s = new ArrayList<>();
        s.add(new Student("zhangsan", 23));
        s.add(new Student("lisi", 24));
        Object[] arr = s.stream().map(new Function<Student, String>() {
            @Override
            public String apply(Student student) {
                return student.getName() + "-" + student.getAge();
            }
        }).toArray();
        for (Object o : arr) {
            System.out.println(o);
        }
    }
}
